import React, {Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
import Wrapper from '../wrapper'
class ResetPasswordSuccess extends Component{
    constructor (props){
        super(props);
        this.state = {
            counts:3
        }
    }
    componentDidMount(){
       var a = setInterval(function() {
            var counts = this.state.counts;
            if( counts > 1 ) {
               counts = counts - 1;
                this.setState( { counts: counts} );
            }else{
                 clearInterval(a);
                 window.location.href='/login'
            };
        }.bind(this),1000);
    }
        
    render() {
        var counts = this.state.counts;   
        return (
            <Wrapper>
            <div className="row" style={{paddingTop:"40px",background:"#f5f8fa"}}>
                <h4 className="col-md-offset-2" style={{marginBottom:"20px",color:"#0091ae"}}>重置密码</h4>
                <div className="col-md-8 col-md-offset-2 bg-info">
                    <div className="col-md-2" style={{height:"380px"}}>
                        
                    </div>
                    <div className="col-md-4 col-md-offset-2 text-center" style={{fontSize:"16px",color:"#0091ae"}}>
                       <span className="glyphicon glyphicon-ok-sign" style={{fontSize:"90px",paddingTop:"100px",marginBottom:"30px",color:"#0091ae"}}></span>
                        <p >您的密码已经重置成功！</p>
                        <p>{counts}秒后跳转至 <a href="/login" style={{fontSize:"18xp",color:"#ff7a59"}}> 登录</a></p>
                    </div>
                </div>               
             </div>
            </Wrapper>
        );
    }
};

ReactDOM.render(
    <ResetPasswordSuccess />,
    document.getElementById('resetpasswordsuccess')
);